<?php
//1. 跨域设置
header("access-control-allow-origin:*");
//2. 包含文件
include_once("./utils/db.php");
include_once("./utils/functions.php");

$sql="select * from xk_student";

$students=[];
$results=mysqli_query($conn,$sql);

while($row=mysqli_fetch_assoc($results)){
  $students[]=$row;
}

//4. 输出位json数据
echo json_encode($students,JSON_UNESCAPED_UNICODE);